/* $Id: AppMetaDataFacade.java 
 * Copyright (C) 2011, TRAKHEES
 *  
 * Revision History
 *
 * Date  			Author 		    	Remarks
 * ---------------------------------------------------------------------------------
 *
 */
package ae.pcfc.etks.online.common.facade;

import java.util.List;

import ae.pcfc.etks.online.common.ConstantsCommon.WFProcessType;
import ae.pcfc.etks.online.common.vo.AdminApprovalVO;
import ae.pcfc.etks.online.common.vo.AppMetaDataDetailVO;
import ae.pcfc.etks.online.common.vo.AppMetaDataVO;
import ae.pcfc.etks.online.common.vo.LabelVO;
import ae.pcfc.etks.online.common.vo.WorkflowRequestSearchCriteriaVO;
import ae.pcfc.etks.online.common.vo.WorkflowRequestVO;

public interface AppMetaDataFacade extends Facade {

	/**
	 * findAppMetaDataByPrimaryKey:	Method to get AdminApproval Object by application ID
	 * This method acquires the AppMetaData domain object and adds the information to AdminApprovalVO along with the other application details
	 * like supporting documents
	 * @param	applicationId String
	 * @return	AdminApprovalVO
	 */
	public AdminApprovalVO findAppMetaDataByPrimaryKey(String applicationId);

	/**
	 * findAppMetaDataByUserId:	Method to get find all the Application requests user ID
	 * This method acquires the AppMetaData domain objects for the user from the AppMetaDataDomainObjectManager
	 * @param	userId Long	Unique User ID
	 * @return	List<AppMetaDataDetailVO> - returns a list of AppMetaDataDetailVO
	 */
	public List<AppMetaDataDetailVO> findAppMetaDataByUserId(Long id);

	/**
	 * findAppMetaDataByClientRefNo
	 * findAppMetaDataByClientRefNo:	Method to get find all the Application requests by Client Ref Number
	 * This method acquires the AppMetaData domain objects from the AppMetaDataDomainObjectManager
	 * @param	refNo String
	 * @return	List<AppMetaDataDetailVO> - returns a list of AppMetaDataDetailVO
	 */
	public AppMetaDataDetailVO findAppMetaDataByClientRefNo(String refNo);

	/**
	 * findCompletedAppMetaDataByUserId: Method to find the completed application requests of a user
	 * This method acquires the AppMetaData domain objects for the user from the AppMetaDataDomainObjectManager
	 * @param	userId Long	Unique User ID
	 * @return	- List<AppMetaDataDetailVO> - returns a list of AppMetaDataDetailVO
	 */
	public List<AppMetaDataDetailVO> findCompletedAppMetaDataByUserId(Long id);
	
//	public List<AppMetaDataDetailVO> findCompletedAppMetaDataByUserId(AppMetaDataDetailVO appMetaDataDetailVO);
	
	/**
	 * findAppMetaDataDetailVOByExample:	Method to get all the Application requests by an example VO
	 * This method acquires the AppMetaData domain objects for the user from the findAppMetaDataByExample
	 * Then using the dozer bean mapper converts it to AppMetaDataDetailVO object
	 * @author Dicetek.Ismail
	 * @param	appMetaDataVO AppMetaDataVO	  Example VO with fields filled for filtering the results
	 * @return	- List<AppMetaDataVO> - returns a list of AppMetaDataVO
	 */
	public List<AppMetaDataVO> findAppMetaDataVOByExample(AppMetaDataVO appMetaDataVO);
	
	/**
	 * findAppMetaDataDetailVOByExample:	Method to get all the Application requests by an example VO
	 * This method acquires the AppMetaData domain objects for the user from the findAppMetaDataByExample
	 * Then using the dozer bean mapper converts it to AppMetaDataDetailVO object
	 * @author Dicetek.Ismail
	 * @param	appMetaDataDetailVO AppMetaDataDetailVO - Example VO with fields filled for filtering the results
	 * @return	- List<AppMetaDataDetailVO> - returns a list of AppMetaDataDetailVO
	 */
	public List<AppMetaDataDetailVO> findAppMetaDataDetailVOByExample(AppMetaDataDetailVO appMetaDataDetailVO);

	
	/**
	 * addApplicationRequest: Method to create application request
	 * @param	appMetaDataVO AppMetaDataVO VO to be updated in DB
	 * @return	-
	 */
	public void addApplicationRequest(AppMetaDataVO appMetaDataVO);

	/**
	 * updateApplicationRequest: Method to update application request details
	 * This method updates only english and arabic status messages of the application
	 * @author Dicetek.Ismail
	 * @param	appMetaDataVO AppMetaDataVO VO to be updated in DB
	 * @return	-
	 */
	public void updateApplicationRequest(AppMetaDataVO appMetaDataVO);

	/**
	 * updateApplicationStatus: Method to update the status of the application request
	 * @author Dicetek.Ismail
	 * @param	applicationId Long	Unique application ID
	 * @param	statusEn String
	 * @param	statusAr String
	 * @return	-
	 */
	public void updateApplicationStatus(String applicationId, String statusEn,String statusAr);

	/**
	 * getApplicationRequest: Method to get application request by application Id
	 * @author Dicetek.Ismail
	 * @param	applicationId Long	Unique application ID
	 * @return	AppMetaDataVO
	 */
	public AppMetaDataVO getApplicationRequest(String applicationId);
	
	

	/**
	 * searchApplicationRequestsByProcessCode:	Method to get all the Application requests belonging to a process
	 * This method acquires the AppMetaData domain objects belonging to the process from the underlying AppMetaDataDomainObjectManager 
	 * @author Dicetek.Ismail
	 * @param	processType WFProcessType
	 * @return	- List<AppMetaDataVO> - returns a list of AppMetaDataVO
	 */
	public List<AppMetaDataVO> searchApplicationRequestsByProcessCode(WFProcessType processType);

	/**
	 * searchApplicationRequestsByInitiator:	Method to get all the Application requests belonging to a user
	 * This method acquires the AppMetaData domain objects belonging to the user from the underlying AppMetaDataDomainObjectManager 
	 * @author Dicetek.Ismail
	 * @param	username String
	 * @return	- List<AppMetaDataVO> - returns a list of AppMetaDataVO
	 */
	public List<AppMetaDataVO> searchApplicationRequestsByInitiator(String username);

	/**
	 * searchApplicationRequestsByApplicationDate:	Method to get find all the Application requests by application date
	 * This method acquires the AppMetaData domain objects for the user from the AppMetaDataDomainObjectManager 
	 * Then using the dozer bean mapper converts it to AppMetaDataVO object
	 * @author Dicetek.Ismail
	 * @param	date String
	 * @return	- List<AppMetaDataVO> - returns a list of AppMetaDataVO
	 *
	 * */
	public List<AppMetaDataVO> searchApplicationRequestsByApplicationDate(String date);

	/**
	 * searchApplicationRequestsByUserId:	Method to get find all the Application requests user ID
	 * This method acquires the AppMetaData domain objects for the user from the AppMetaDataDomainObjectManager 
	 * Then using the dozer bean mapper converts it to AppMetaDataVO object
	 * @author Dicetek.Ismail
	 * @param	userId long	Unique User ID
	 * @return	- List<AppMetaDataVO> - returns a list of AppMetaDataVO
	 */
	public List<AppMetaDataVO> searchApplicationRequestsByUserId(Long userId);

	/**
	 * findAppMetaDataByUserName:	Method to get all the Application requests raised by the user
	 * This method acquires the AppMetaData domain objects for the user from the AppMetaDataDomainObjectManager.
	 * Then using the dozer bean mapper converts it to AppMetaDataDetailVO object
	 * @author Dicetek.Ismail
	 * @param	strUserName String
	 * @return	- List<AppMetaDataDetailVO> - returns a list of AppMetaDataDetailVO
	 */
	public List<AppMetaDataDetailVO> findAppMetaDataByUserName(String strUserName);

	public List<WorkflowRequestVO> findWorkflowRequests(WorkflowRequestSearchCriteriaVO searchCriteria);
	/**
	 * findByIncidentIDAndProcessCode
	 * 
	 * @param string
	 * @param strProcessCode
	 * @return
	 * UserRequestVO
	 */
	public WorkflowRequestVO findByIncidentIDAndProcessCode(String incidentId,String strProcessCode, String strProcessStepCode);
	
	/*
	 * Description:
	 * getNextApplicationId:	Method to getNextApplicationId
	 * 
	 * @param	String
	 * @return	String
	 */
	public String getNextApplicationId();
	
	
	public List<LabelVO> searchRequestStatus(String searchString);

}
